@extends('admin.app')

@section('content')
  <div class="panel panel-default">
    <div class="panel-heading font-bold">
      红包的发放记录
    </div>
    <div class="panel-body">
      <form action="{{ admin_action('Gift\RecordController@index',[$activity]) }}"  class="form-horizontal">
        <div class="form-group">
          <div class="col-sm-1 control-label">用户</div>
          <div class="col-sm-2">
            <input type="text" class="form-control" name="uname" value="{{ $query['uname'] ?? '' }}" placeholder="请输入查询条件">
          </div>
          <div class="pull-right m-r">
            <button class="btn btn-primary" type="submit">查询</button>
          </div>
        </div>
      </form>
      <div class="table-responsive">
        <table class="table table-striped b-t b-light">
          <thead>
            <tr>
              <th>姓名</th>
              <th>用户名</th>
              <th>手机号</th>
              <th>所属红包</th>
              <th>发放时间</th>
              <th>金额</th>
              <th>使用时间</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
            @forelse ($list as $row)
            <tr>
              <td>{{ $row->uname??'--' }}</td>
              <td>{{ $row->username??'--' }}</td>
              <td>{{ $row->phone_number??'--' }}</td>
              <td>{{ $row->name }}</td>
              <td>{{ $row->input_time }}</td>
              <td>{{ number_format($row->money,2) }}</td>
              <td>{{ $row->use_time }}</td>
              <td>
                <a class="btn btn-xs btn-info" href="{{ admin_action('Gift\RecordController@show',['activity'=>$activity,'id'=>$row]) }}" data-toggle="tooltip" title="查看记录详情">
                  <i class="fa fa-info"></i>
                </a>
              </td>
            </tr>
            @empty
            <tr>
              <td colspan="5" class="text-center">没有找到领取记录</td>
            </tr>
            @endforelse
          </tbody>
        </table>
      </div>
    </div>
    <div class="panel-footer">
      <div class="row">
        <div class="col-sm-12 text-right text-center-xs">                
          {{ $links }}
        </div>
      </div>
    </div>
  </div>
@endsection